package com.ceuer.demo.juc.single;

/**
 * 单例模式-饿汉
 */
public class Hungry {
	//单例模式需要-私有化的构造方法
	private Hungry(){}
	
	private final static Hungry HUNGRY = new Hungry();
	
	// 单例对象中的属性-- 可能会浪费空间
	private byte[] data1 = new byte[1024*1024];
	private byte[] data2 = new byte[1024*1024];
	private byte[] data3 = new byte[1024*1024];
	private byte[] data4 = new byte[1024*1024];
	
	
	public static Hungry getInstance(){
		return HUNGRY;
	}
	
}
